program aulti_arrays
    implicit none
    real,dimension(2,4,3) :: a
    
    a(:,:,1)=1.0
    a(:,:,2)=2.0
    a(:,:,3)=3.0
    
    print *, 'a(1,:,:)='
    call dpri(a(1,:,:))
    print *, 'a(2,:,:)='
    call dpri(a(2,:,:))
    
    print *, 'a(:,1,:)='
    call dpri(a(:,1,:))
    print *, 'a(:,2,:)='
    call dpri(a(:,2,:))
    print *, 'a(:,3,:)='
    call dpri(a(:,3,:))
    print *, 'a(:,4,:)='
    call dpri(a(:,4,:))
    
    print *, 'a(:,:,1)='
    call dpri(a(:,:,1))
    print *, 'a(:,:,2)='
    call dpri(a(:,:,2))
    print *, 'a(:,:,3)='
    call dpri(a(:,:,3))

    print *,a 
    contains
    subroutine dpri(mat) 
        implicit none
        real, intent(in) :: mat(:,:)
        integer :: ii,jj
        print *, 'shape = ',shape(mat)
        do ii=1,size(mat,1)
            do jj=1,size(mat,2)
                write(*,'(f8.4)',advance='no') mat(ii,jj)
            end do
            print *,''
        end do
    end subroutine dpri
end program aulti_arrays